// 路由器
import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'
import Login from '@/pages/login.vue'
import index from '@/pages/entry/index.vue'
import dev from '@/pages/entry/dev.vue'
import pcs from '@/pages/entry/pcs.vue'
import bms from '@/pages/entry/bms.vue'
import auto from '@/pages/entry/auto.vue'
import manual from '@/pages/entry/manual.vue'
import proxy from '@/pages/entry/proxy.vue'

// 创建路由器
const router= createRouter({
history:createWebHistory(),//路由器工作模式
    routes:[
        {
            name:"/login",
            path:"/",
            component: Login
        },
        {
            name:"/topic",
            path:"/topic",
            component: index,
            redirect:"/topic/bms",
            children:[
                {
                    name:"pcs",
                    path:"/topic/pcs",
                    component: pcs
                },
                {
                    name:"bms",
                    path:"/topic/bms",
                    component:bms
                },
                {
                    name:"auto",
                    path:"/topic/auto",
                    component:auto
                },
                {
                    name:"manual",
                    path:"/topic/manual",
                    component:manual
                },
                {
                    name:"proxy",
                    path:"/topic/proxy",
                    component:proxy
                }
            ]
        }
    ]
})

export default router